import { IsNotEmpty, Length, IsString, IsNumber, IsOptional } from 'class-validator';

class Common {
    @Length(1, 30)
    @IsString()
    name:string;

    @Length(1, 20)
    @IsString()
    code:string;
}


export class AddDto extends Common {
    @IsNumber()
    @IsNotEmpty()
    @IsOptional()
    parentId:number;

    @IsNumber()
    @IsNotEmpty()
    categoryId:number;
}

export class UpdateDto extends Common {
    
}